<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>活动管理</title>

<link href="${rc.getContextPath()}/resources/css/common.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="${rc.getContextPath()}/resources/js/jquery.js"></script>
<script type="text/javascript" src="${rc.getContextPath()}/resources/js/common.js"></script>
<script type="text/javascript" src="${rc.getContextPath()}/resources/js/list.js"></script>
<script type="text/javascript" src="${base}/js/My97DatePicker4_8/WdatePicker.js"></script>
 <!-- 引入弹出JS begin -->
<script type="text/javascript" src="${rc.getContextPath()}/js/lhgdialog/lhgdialog.min.js?self=true"></script>
<!-- 引入弹出JS end -->
<script type="text/javascript">
var base;
$(document).ready(function(){
	 base = '${rc.getContextPath()}';
	var $listForm = $("#listForm");
	var $ids = $("#listTable input[name='ids']");
	var $deleteButton = $("#deleteButton");
	var $selectAll = $("#selectAll");
	var $contentRow = $("#listTable tr:gt(0)");
	
	
	
	$deleteButton.unbind();
	$deleteButton.click( function() {
		var $this = $(this);
		if ($this.hasClass("disabled")) {
			return false;
		}
		var $checkedIds = $("#listTable input[name='ids']:enabled:checked");
		
		
		$.dialog.confirm('是否确定删除?',function(){
			$.dialog.tips('数据删除中...',999999,'loading.gif');
			$.ajax({
 				type: 'POST',
 				dataType : "json",
 				data:{"eventIdStr":getCheckBox()},
 				url:  "${rc.getContextPath()}/event/admin/deleteEvent.html",
 				error: function () {//请求失败处理函数
 					$.dialog.alert('请求失败,请联系网站管理员！');
					$deleteButton.addClass("disabled");
 				},
 				success:function(data){ //请求成功后处理函数。 
 					 					$.dialog.tips('数据删除中...',0,'loading.gif');
 					if(data.result=='success'){
	 					$.dialog.alert('删除成功！',function(){
							$selectAll.prop("checked", false);
							$checkedIds.prop("checked", false);
	    					$deleteButton.addClass("disabled");
							window.location.reload(true);
	
	 					});
 					}else{
 						$.dialog.alert(data.result,function(){
							$selectAll.prop("checked", false);
							$checkedIds.prop("checked", false);
	    					$deleteButton.addClass("disabled");
							window.location.reload(true);
	
	 					});
 					
 					}

 				}
 			});
		},function(){},this);

	});
	
 
	
});

function getCheckBox(){
	 
    var ids="";
    $("input[name='ids']:checked").each(function(){  
             ids += $(this).val()+",";
     });
    if (ids.length > 0 ) ids = ids.substring(0, ids.length-1);      
	  return ids;

}


function refreshIframe(){
	window.location.reload(true);
}

 

</script>

</head>

<body    >
	<div class="path">
		活动管理 &raquo; 活动列表
	</div>

<form id="listForm" action="${rc.getContextPath()}/event/admin/list.html" method="post">
	<!-- 隐藏域 begin-->
		  
    <!-- 隐藏域 end-->
		<div class="bar">

			<a href="${base}/event/admin/addEvent.html" class="iconButton"  >
				<span class="addIcon">&nbsp;</span>增加
			</a>
	 
			<div class="buttonWrap"> 
	 
				<a href="javascript:;" id="deleteButton" class="iconButton disabled"  >
					<span class="deleteIcon">&nbsp;</span>删除
				</a>
 
			</div>
 			<div class="menuWrap">
				<div class="search">
					<span id="searchPropertySelect" class="arrow">&nbsp;</span>
					<input type="text" id="searchValue" name="searchValue" value="${searchValue!}" maxlength="200" />
					<button type="submit">&nbsp;</button>
				</div>
				<div class="popupMenu">
					<ul id="searchPropertyOption">
						<li>
							<a href="javascript:;" <#if searchProperty??&&searchProperty=='title'> class="current" </#if>   val="title">活动名</a>
						</li>
 						<li>
							<a href="javascript:;" <#if searchProperty??&&searchProperty=='eventVenue'> class="current" </#if>    val="eventVenue">活动地点</a>
						</li>
						
					</ul>
				</div>
				<@s.pageBox page/>
				<div style="vertical-align: middle;padding: 2px 0;">
				 活动 时间:
					 
							<input id="time" name="time" type="text" style="width:140px;"
		value="${(time?string('yyyy-MM-dd HH:mm:ss'))!}"
		onFocus="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss' })"
		readonly="readonly" />
 
				</div>
				
			</div>	
			 
		</div>	
		<table id="listTable" class="list">
			<tr>
				 <th class="check">
					<input type="checkbox" id="selectAll" />
				</th>



				<th>
					<a href="javascript:;"  >活动名</a>
				</th>
				<th>
					<a href="javascript:;"  >活动地点</a>
				</th>
				<th>
					<a href="javascript:;"  >活动详细时间</a>
				</th>
				 <th>
					<a href="javascript:;"  >活动发布时间</a>
				</th>
				<th>
					<a href="javascript:;"   >活动截至时间</a>
				</th>
				<th>
					<a href="javascript:;"   >活动状态</a>
				</th>
				<th>
					<a href="javascript:;"   >操作</a>
				</th>
			</tr>	
				
	<#if page.list??>
		<#list page.list as event>
		
				<tr>
					<td>
						<input type="checkbox" name="ids" value="${event.id}" />
					</td>


					<td>
 					    <span > 
							 ${event.title}
						</span>
 
					</td>
					<td>
						<span > 
							${event.eventVenue!}
						</span>
					</td>
										<td>
						<span > 
							${event.eventTime!}
						</span>
					</td>
					 <td>
						<span > 
							${event.releaseTime?string('yyyy-MM-dd  HH:mm:ss')}
						</span>
					</td>
					
					<td>
						<span > 
							${event.expireTime?string('yyyy-MM-dd  HH:mm:ss')}
						</span>
					</td>
					 <td>
						<span > 
							<#if event.eventStatus==1>
								发布
							<#else>
								屏蔽
							</#if>
						</span>
					</td>
 					 <td>
						 <a href="${base}/event/admin/editEvent.html?eventId=${event.id}">修改</a>

					</td>
				</tr>
			</#list>
		</#if>
		</table>
 <#include "${rc.getContextPath()}/common/pagination.html"/>
	</form>


</body>
</html>
	